/********************************************************************************
 * Project Name		[JavaSE_Fundamentals]
 * File Name     	[TestLocale.java]
 * Creation Date 	[2015-01-01]
 * 
 * Copyright© ge.y.yang@gmail.com All Rights Reserved
 * 
 * Work hard, play harder, think big and keep fit
 ********************************************************************************/
package api.util;

import java.util.Locale;

/**
 * java.util.Locale测试
 * 
 * @author 不落的太阳(Sean Yang aka ShortPeace)
 * @version 1.0
 * @since jdk 1.8
 * 
 */
public class TestLocale {

	/**
	 * 测试Locale.Builder
	 */
	public static void testLocaleBuilder() {
		Locale locale = new Locale.Builder().setLanguage("ja").setRegion("JP").build();
		System.out.println("Language: " + locale.getLanguage());
		System.out.println("Display Language: " + locale.getDisplayLanguage());
		System.out.println("Country: " + locale.getCountry());
		System.out.println("Display Country: " + locale.getDisplayCountry());
		System.out.println("Display Name: " + locale.getDisplayName());
		System.out.println();
	}

	public static void main(String[] args) {
		Locale locale = Locale.getDefault();
		System.out.println("Language: " + locale.getLanguage());
		System.out.println("Display Language: " + locale.getDisplayLanguage());
		System.out.println("Country: " + locale.getCountry());
		System.out.println("Display Country: " + locale.getDisplayCountry());
		System.out.println("Display Name: " + locale.getDisplayName());
		System.out.println();

		locale = new Locale("en", "US");
		System.out.println("Language: " + locale.getLanguage());
		System.out.println("Display Language: " + locale.getDisplayLanguage());
		System.out.println("Country: " + locale.getCountry());
		System.out.println("Display Country: " + locale.getDisplayCountry());
		System.out.println("Display Name: " + locale.getDisplayName());
		System.out.println();

		locale = Locale.GERMANY;
		System.out.println("Language: " + locale.getLanguage());
		System.out.println("Display Language: " + locale.getDisplayLanguage());
		System.out.println("Country: " + locale.getCountry());
		System.out.println("Display Country: " + locale.getDisplayCountry());
		System.out.println("Display Name: " + locale.getDisplayName());
		System.out.println();

		testLocaleBuilder();
	}
}
